<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p class="div1">我是div</p>
    <script>
        let obj1 = {
            age: 18,
            name: 'Tom'
        };
        let div1 = document.querySelector('.div1');
        // console.log(typeof div1);
        // obj1.el = div1;
        // console.log(obj1.el);
        // obj1[div1] = 666;
        // console.log(obj1);

        let map1 = new Map();
        // 设置值或者添加值
        map1.set('age', obj1.age);
        map1.set('age', 28);
        map1.set('name', obj1.name);
        map1.set(true, 10086);
        map1.set('true', 10010);
        map1.set(div1, '我是div')

        let res1 = map1.get(true);
        console.log(res1);
        let res2 = map1.has('dii6t3v1');
        console.log(res2);
        console.log(map1);

        // ============ 遍历map ==============
        console.log(map1.keys());
        console.log(map1.values());
        console.log(map1.entries());
        map1.forEach(item => {
            console.log(item);
        })
    </script>
</body>
</html>